package com.timesheet.gui.efforttracker.providers;

import java.util.List;

import org.eclipse.jface.viewers.IContentProvider;
import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

import com.timesheet.gui.efforttracker.container.UtilisationModelContainer;
import com.timesheet.server.common.models.EffortTrackerDTO;

public class DetailedUtilisationContentProvider implements IStructuredContentProvider {

	@Override
	public void dispose() {
		// TODO Auto-generated method stub

	}

	@Override
	public void inputChanged(Viewer arg0, Object arg1, Object arg2) {
		// TODO Auto-generated method stub

	}

	@Override
	public Object[] getElements(Object arg0) {
		UtilisationModelContainer modelContainer = UtilisationModelContainer.getInstance();
		List<EffortTrackerDTO> detailedUtilisationList = modelContainer.getDetailedUtilisationList();
		if(detailedUtilisationList!=null){
			return detailedUtilisationList.toArray();
		}
		return null;
	}

}
